<?php 
if ($_GET[van] == '' || !is_numeric($_GET[van]) || $_GET[van] < 1) {
	header("Location:$_SERVER[PHP_SELF]?van=1");
}

$title = "DTPG&trade; Route Manager: Van &#35;$_GET[van]";

require('../shared/connect.php');
?>

<!DOCTYPE html>
<html>
	<head>
		<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
		<title><?php echo $title ?></title>
		<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key=AIzaSyBzupUgxVoM4Pb2roT72SBLYDO1Mcc0hn8&amp;sensor=true"></script>
		<script type="text/javascript" src="js/god.js<?php echo "?" . rand(); // WARNING: prevents js caching. remove this php snippet when moving to production  ?>"></script>

		<link rel="stylesheet" type="text/css" href="css/jquery-ui.css" />
		<link rel="stylesheet" type="text/css" href="css/jquery.mCustomScrollbar.css" />
		<link rel="stylesheet" type="text/css" href="css/main.css<?php echo "?" . rand(); // WARNING: prevents js caching. remove this php snippet when moving to production  ?>" />

	</head>
	<body onload="initialize('<?php echo $_GET[van]; ?>')">
		<div id="control_panel">
			<div id="title_container">
				<div id="title_bar">
					<strong><?php if ($_GET[van] > 1) echo "<div style=\"position:absolute; right:100%;padding-right:.2%;\"><a href=\"$_SERVER[PHP_SELF]?van=".($_GET[van]-1)."\">&laquo;</a></div>"; echo "<div style=\"float:left;\">$title</div><div style=\"float:left;padding-left:.2%;\"><a href=\"$_SERVER[PHP_SELF]?van=".($_GET[van]+1)."\">&raquo;</a></div><div style=\"clear:both;\"></div>"; ?></strong>
				</div>
			</div>
			<div id="header_container">
				<div id="header_inputs">
					<div id="inputs">
						<form id="add_location" onsubmit="insertJSONLocation();return false;">
							<table id="address_list">
								<tr>
									<th>Pickup</th>
									<th>Dropoff</th>
									<th>Size</th>
								</tr>
								<tr>
									<td><input name="pickup" id="pickup" class="input_box"/></td>
									<td><input name="dropoff" id="dropoff" class="input_box"/></td>
									<td><input name="size" id="size" class="input_box"/></td>
								</tr>
							</table>
							<input type="submit" id="addRequest" value="Add Request"/>
							<button type="button" id="deleteAll" onclick="deleteLocations();this.form.reset();">
								Delete All
							</button>
						</form>
					</div>
				</div>
				
			</div>
			<div id="locations_container" class="scroll">
				<div id="locations_panel"></div>
			</div>
			<div id="map_canvas"></div>
			<div id="directions_container" class="scroll">
				<div id="directions_panel"></div>
			</div>
			
			<div style="clear:both"></div>
			<div id="outputDiv_container" class="scroll">
				<div class="hborder" style="background-color:#999"></div>
				<div id="outputDiv"></div>
			</div>
			<div id="suboutputDiv_container" class="scroll">
				<div class="hborder" style="background-color:#999"></div>
				<div id="suboutputDiv"></div>
			</div>
			<div style="clear:both"></div>
		</div>

	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
	<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
	<script src="js/jquery.mousewheel.min.js"></script>
	<script src="js/jquery.mCustomScrollbar.js"></script>

	<script>
	(function($){
		$(window).load(function(){
			$(".scroll").mCustomScrollbar({scrollInertia:0});
		});
	})(jQuery);
	</script>

	</body>
</html>